<!DOCTYPE html>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
    <style type="text/css">
        body, html, #allmap {
            width: 100%;
            height: 100vh;
            overflow: hidden;
            margin: 0;
            font-family: "微软雅黑";
        }
    </style>
    <!--    <script type="text/javascript" src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=EzwrA4B6p0zciuoBiHugTS9BvBlBfGyZ"></script>-->
    <script type="text/javascript"
            src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=5xjTX2dVakjjsYEG4sMFSrO6QFkEryRL"></script>
    <title>车辆实时位置3D视图</title>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
    // GL版命名空间为BMapGL
    // 按住鼠标右键，修改倾斜角和角度
    var map = new BMapGL.Map("allmap");    // 创建Map实例
    var pt = new BMapGL.Point([[${lng}]], [[${lat}]]);
    map.centerAndZoom(pt, 19);  // 初始化地图,设置中心点坐标和地图级别
    map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
    map.setHeading(64.5);
    map.setTilt(72);

    var myIcon = new BMapGL.Icon('https://maponline0.bdimg.com/sty/map_icons2x/MapRes/qiche.png', new BMapGL.Size(40, 42));
    var marker = new BMapGL.Marker(pt, {
        icon: myIcon
    });  // 创建标注
    map.addOverlay(marker);              // 将标注添加到地图中

    var opts = {
        position: pt,    // 指定文本标注所在的地理位置
        offset: new BMapGL.Size(-100, -60)    //设置文本偏移量
    };

    var label = new BMapGL.Label("车辆位置在这!", opts);  // 创建文本标注对象
    label.setStyle({
        color: 'red',
        fontSize: '20px',
        lineHeight: '30px',
        fontFamily: '微软雅黑'
    });
    map.addOverlay(label);


    var navi3DCtrl = new BMapGL.NavigationControl3D();  // 添加3D控件
    map.addControl(navi3DCtrl);
    var zoomCtrl = new BMapGL.ZoomControl();  // 添加比例尺控件
    map.addControl(zoomCtrl);

</script>


